<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>对象数组</title>
		<script>
			var a1=[];
			// var ar=[1,2,3,5];
			//var ar=["11","laowu","xiaozhang"];
			var ar = [{
					name: "阳朔",
					age: 20,
					marry: false,
					birthday: '1999-1-2',
					phone: "138888788",
					show: function() {
						alert("这个人叫" + this.name + ".今年" + this.age + "岁");
					},
					incr: function(a) {
						this.age += a;
					},
					toString: function() {
						return "这个人叫" + this.name + ".今年" + this.age + "岁";
					}
				},
				{
					name: "何照耀",
					age: 17,
					marry: true,
					birthday: '2003-1-2',
					phone: "1377777",
					show: function() {
						alert("这个人叫" + this.name + ".今年" + this.age + "岁");
					},
					incr: function(a) {
						this.age += a;
					},
					toString: function() {
						return "这个人叫" + this.name + ".今年" + this.age + "岁";
					}
				},
				{
					name: "王凯旋",
					age: 18,
					marry: false,
					birthday: '2000-1-2',
					phone: "138888788",
					show: function() {
						alert("这个人叫" + this.name + ".今年" + this.age + "岁");
					},
					incr: function(a) {
						this.age += a;
					},
					toString: function() {
						return "这个人叫" + this.name + ".今年" + this.age + "岁";
					}
				}
			];
			alert(ar.length);
			for(let i=0;i<ar.length;i++)
			{
				ar[i].show();
			}
		</script>
	</head>
	<body>
	</body>
</html>
